/*
 * WhatsThisManagerDelegate.h  0.4.0 / Nov 17, 2010
 *
 * Copyright (c) 2010 - 2011, cute4j.com and contributors.
 *
 * This software is licensed under the LGPL version 2.1 license.
 * A copy of this license is included in the file LICENSE-LGPL.txt.
 */
#ifndef WHATSTHISMANAGERDELEGATE_H
#define WHATSTHISMANAGERDELEGATE_H

#include "Cute4jSwing.h"

// WhatsThisManagerDelegate Class. ---------------------------------------------

/*!
 * \brief WhatsThisManager Delegate.
 *
 * \author Slobodan Vrkacevic
 * \version 0.4.0
 */
class CUTE4J_EXPORT WhatsThisManagerDelegate
{
public: // native calls
  static void setEnabled(JNIEnv *env, jclass cls, jboolean enabled);
  static void showText(JNIEnv *env, jclass cls, jstring text, jint x, jint y,
                       jlong componentDelegate);
  static void hideText(JNIEnv *env, jclass cls);
  static jboolean isInWhatsThisMode(JNIEnv *env, jclass cls);
  static void enterWhatsThisMode(JNIEnv *env, jclass cls);
  static void exitWhatsThisMode(JNIEnv *env, jclass cls);
public:
  inline static bool whatsThisEnabled();
private:
  static bool sm_enabled;
};

// WhatsThisManagerDelegate :: Public Static Inline Member Function. -----------

/*!
 * \brief Returns \c true if the whatsThis help is enabled.
 *
 * \return \c true if the whatsThis help is enabled
 */
inline bool WhatsThisManagerDelegate::whatsThisEnabled()
{
  return sm_enabled;
}

// Macro Definition. -----------------------------------------------------------

#define WHATS_THIS_MANAGER_DELEGATE \
    (reinterpret_cast<WhatsThisManagerDelegate *>(delegate))

#endif //WHATSTHISMANAGERDELEGATE_H

